<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>vue</title>
  </head>
  <script src="./vue.js"></script>

  <body>
    <!-- 模板 -->
    <div id="example">
      <h2>使用slot进行内容分发</h2>

      <c-alert>
        <div slot="one">我要替换提醒1</div>
        <template>
          <div slot="one">我要替换提醒2</div>
          <div slot="one">我要替换提醒2</div>
        </template>
      </c-alert>
    </div>

    <script>
      Vue.component('CAlert', {
        template: `
			<div>
				<slot name="one">这是提醒1</slot>
				<slot name="two">这是提醒2</slot>
				<slot name="three">这是提醒3</slot>
			</div>
			`
      })

      //vm实例
      var vm = new Vue({
        el: '#example'
      })
    </script>
  </body>
</html>
